<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
	.tree-node {padding:0;}
</style>
<script type="text/javascript">
	$(function() {
		$('#toolbar_tagTable').toolbar({buttons:[
           	{name:'add',iconCls:'icon-add',text:'添加标签'},
       		{name:'reload',iconCls:'icon-reload',text:'刷新'}
      	],handler:handler});
	    $('#category_grid').datagrid({
    		url:'page',
    		pagination:true,
    		singleSelect:true,
    		pageSize:20,
    		rownumbers:true,
    		striped:true,
    		fitColumns:true,
    		fit:true,
    		toorbar:'#toolbar_tagTable',
    		columns:[[
        		{field:'name',title:'名称',width:'20%'},
        		{field:'note',title:'备注',width:'20%'},
        		{field:'createDt',title:'创建时间',width:'20%'},
        		{field:'updateDt',title:'更新时间',width:'20%'},
        		{field:'-',title:'操作',formatter:function(v,r,i){
					return '<a href="#" onclick="toEdit('+r.id+');">编辑</a>';
				}}
    		]]
		 });
		function handler() {
			switch(this.name) {
				case 'add': toAdd();break;
				case 'reload': toEdit(reload);break;
				case 'edit': toEdit();break;
			}
		}
		function toAdd() {
			show({code:'tag_info_add',title:'添加标签信息',iconCls:'icon-add',uri:'add',width:500,height:500,
				options : {
					success : function(data) { 
						$('#category_grid').datagrid('reload'); 
					}
				}
			});
		}
	});
	function toEdit(item) {
		show({code:'tag_info_edit',title:'编辑标签信息',iconCls:'icon-edit',uri:'edit?id='+item,width:500,height:500,
			options : {
				success : function(data) { 
					$('#category_grid').datagrid('reload'); 
				}
			}
		});
	}
</script>
</head>
<body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north',border:false">
			<fieldset>
    		<legend>查询信息</legend>
    		<table>
    			<tr>
    				<td>名称:<input class="easyui-textbox" data-options="prompt:'请输入标签名称'" ></td>
    				<td>
    					添加时间:
				<input class="easyui-combobox" 
					name="language"
					data-options="
						url:'',
						method:'get',
						valueField:'id',
						textField:'text',
						panelHeight:'auto'">
    				</td>
    				<td><a href="a_searchTag" class="easyui-linkbutton" iconCls="icon-search">查询</a></td>
    			</tr>
    		</table>
  			</fieldset>
		</div>
  		<div data-options="region:'center',border:false" style="padding-bottom: 33px">
  			
        	<div id="toolbar_tagTable" class="toolbar"></div>
  			<table id="category_grid"></table>
		</div>
	</div>
</body>
</html>